package com.ynet.middleground.office.filter;

import org.dozer.DozerBeanMapper;
import org.dozer.Mapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * Dozer对象转换
 * @author yangbh
 */
@Configuration
public class DozerConfig {

    @Bean
    public Mapper mapper()  {

        List files = new ArrayList<>();

        files.add("dozer/dozerJdk8Converters.xml");
        files.add("dozer/dozer-mapping.xml");

        DozerBeanMapper mapper = new DozerBeanMapper();

        mapper.setMappingFiles(files);

        return mapper;
    }

}
